Skip to content

Fix equals syntax for accelerate config - #6925

Closed
DaoyuanLi2816 wants to merge 1 commit into
huggingface:mainfrom
DaoyuanLi2816:fix/accelerate-config-equals
Closed

Fix equals syntax for accelerate config#6925
DaoyuanLi2816 wants to merge 1 commit into
huggingface:mainfrom
DaoyuanLi2816:fix/accelerate-config-equals

Conversation

@DaoyuanLi2816

@DaoyuanLi2816 DaoyuanLi2816 commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

What does this PR do?

Normalize the standard --accelerate_config=<name> spelling before forwarding launch arguments to Accelerate. Both the equals form and the existing two-token form now resolve packaged configurations while preserving the remaining launch arguments.

Fixes #6874

Before submitting

  • This PR fixes a typo or improves the docs (you can dismiss the other checks if that's the case).
  • Did you read the contributor guideline, Pull Request section?
  • Was this discussed/approved via a GitHub issue? Please add a link to it if that's the case.
  • Did you make sure to update the documentation with your changes?
  • Did you write any new necessary tests?

AI writing disclosure

We welcome the use of AI tools to help with contributions. For transparency and to help us improve our review process, please indicate the level of AI involvement in this PR.

  • No AI usage: the PR was written entirely by a human.
  • AI-assisted: some parts were suggested or improved by AI, but the PR was written and reviewed by a human.
  • AI-generated: the PR was mostly or fully generated by an AI tool.

Who can review?

Anyone in the community is free to review the PR once the tests have passed. Feel free to tag members/contributors who may be interested in your PR.


Note

Low Risk
CLI-only argument parsing change with new unit tests; no auth, data, or training logic touched.

Overview
resolve_accelerate_config_argument now accepts --accelerate_config=<name> in addition to the two-token --accelerate_config <name> form, strips the correct number of argv tokens for each spelling, and raises ValueError when the equals form has no value (e.g. --accelerate_config=).

Behavior is unchanged otherwise: packaged names still map to trl/accelerate_configs, paths still work, and the flag is still rewritten to --config_file with trailing launch args preserved.

Adds tests/test_accelerate_config.py with parametrized coverage for both spellings and missing-value cases. Fixes #6874.

Reviewed by Cursor Bugbot for commit 382ccac. Bugbot is set up for automated code reviews on this repo. Configure here.

@DaoyuanLi2816

Copy link
Copy Markdown
Contributor Author

Closing in favor of #6875, which predates this PR and already covers the same #6874 fix, including both argument spellings, empty-value validation, and CLI integration coverage.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug: normalize --accelerate_config=<name> CLI syntax

1 participant